<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="stylesheet" href="main.css" type="text/css" media="all"/> 
	<title>JIPDA</title>
	<script type="text/javascript" src="../jipda/lib/esprima.js"></script>
	<script type="text/javascript" src="../jipda/common.js"></script>
	<script type="text/javascript" src="../jipda/lattice/lattice.js"></script>
	<script type="text/javascript" src="../jipda/lattice/lattice1.js"></script>
	<script type="text/javascript" src="../jipda/address/address.js"></script>
	<script type="text/javascript" src="../jipda/address/tagAg.js"></script>
	<script type="text/javascript" src="../jipda/benv/defaultBenv.js"></script>
	<script type="text/javascript" src="../jipda/ast.js"></script>
	<script type="text/javascript" src="../jipda/visited.js"></script>
	<script type="text/javascript" src="../jipda/eval.js"></script>
	<script type="text/javascript" src="../jipda/jipda.js"></script>
	<script type="text/javascript" src="../jipda/transform.js"></script>
	<script type="text/javascript" src="lib/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="lib/d3.v2.min.js"></script>
	<script type="text/javascript" src="lib/ace/ace.js"></script>
	<script type="text/javascript" src="graph.js"></script>
	<script type="text/javascript">

	// define print method for JIPDA
   var print = function () { console.log(Array.prototype.slice.call(arguments).join(" ")) }		
	var editor;
	 
	function doIt()
	{
		$("#resultValue").empty();
	  var source = editor.getSession().getValue();
		var ast = createAst(source);
		var lat = new Lattice1();
		var jipda = new Jipda({lattice: lat, k:0, ag:tagAg});
		var result = jipda.evalNode(ast);
		var value = result.map(State.topOfStack).reduce(Lattice.join, BOT);
		$("#resultValue").text(value);
	}
		
	$(function ()
	{
	  editor = ace.edit("editor");
	  editor.getSession().setMode("ace/mode/javascript");
	})
		
	</script>
</head>

<body>
	<div id="editor" style="width: 640px; height: 480px;"></div>
	<div id="manip" style="position: absolute; top:490px;">
		<button id="eval" name="eval" onClick="doIt()">Eval</button>
		<span id="resultValue"></span>
	</div>
	<div id="params" style="position:absolute; left:400px; width:400px; height:480px;"/>
</body>

</html>
</html>
</html>